import { createRouter, createWebHashHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';
import OrderView from '../views/OrderView.vue'; // 你的点餐主界面
import OrderHistoryView from '../views/OrderHistoryView.vue'; // 订单历史界面

import OrderManagerView from '../views/OrderManagerView.vue';
import OrderRoomView from '../views/Room/OrderRoomView.vue';
import RoomHistoryView from '../views/Room/RoomHistoryView.vue';
import RoomPrintView from '../views/Room/RoomPrintView.vue';

import NormalRouterView from '../views/NormalRouterView.vue';
import CdManagerView from '../views/Manager/CdManagerView.vue';
import WeekMenuUploadView from '../views/Manager/WeekMenuUploadView.vue';
import WeekRoomView from '../views/Manager/WeekRoomView.vue';

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
  },
  {
    path: '/order',
    name: 'order',
    component: OrderView,
  },
  {
    path: '/history',
    name: 'history',
    component: OrderHistoryView,
  },
  {
    path: '/orderManager',
    name: 'orderManager',
    component: OrderManagerView,
  },
  {
    path: '/orderRoom',
    name: 'orderRoom',
    component: OrderRoomView,
  },
  {
    path: '/roomHistory',
    name: 'roomHistory',
    component: RoomHistoryView,
  },
  {
    path: '/roomPrint',
    name: 'roomPrint',
    component: RoomPrintView,
  },

  //食堂维护
  {
    path: "/manager",
    name: "manager",
    component: NormalRouterView,
    meta: {
      routers: [
        // {
        //   link: '/manager/weekCd',
        //   text: '下周菜单上传',
        // },
        {
          link: '/manager/cdManager',
          text: '菜单维护',
        },
        {
          link: '/manager/weekRoomManager',
          text: '预约记录',
        },
      ],
    },
    children: [
      // {
      //   path: "/manager/weekCd",
      //   name: "weekCd",
      //   component: WeekMenuUploadView,
      // },
      {
        path: "/manager/cdManager",
        name: "cdManager",
        component: CdManagerView,
      },
      {
        path: "/manager/weekRoomManager",
        name: "weekRoomManager",
        component: WeekRoomView,
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;
